﻿using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;

namespace Ooaavee.Events
{
    /// <summary>
    /// Results of the EventWatcher.
    /// </summary>
    [DebuggerDisplay("{GetDebuggerDisplayMessage()}")]
    public class EventWatcherResults
    {
        /// <summary>
        /// Number of received events.
        /// </summary>
        public int EventCount { get { return ReceivedEvents.Count; } }

        /// <summary>
        /// Received events.
        /// </summary>
        public ReadOnlyCollection<IEvent> ReceivedEvents { get; internal set; }


        #region Debugger

        /// <summary>
        /// Gets the results of this EventWatcher for the use of DebuggerDisplayAttribute.
        /// </summary>
        /// <returns>Results.</returns>
        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "See DebuggerDisplayAttribute marked on this class.")]
        private string GetDebuggerDisplayMessage()
        {
            return string.Format("EventWatcherResults, EventCount = {0}", EventCount);
        }

        #endregion
    }
}